#上面放置 自带库


#中间放入 django 自带库
from django.shortcuts import render
from django.views import View

#下面导包 或 三方库
from . import models
from index.models import tb_team    #导入团体

class index(View):
    '''
        /aqours/ /
        像前端返回所需要的 图片和专辑
        暂时先全部返回
    '''
    def get(self,request,name):

        '''
             根据名字进行查询
        
        '''
        team = tb_team.objects.filter(team_name=name).first()
        #人物
        aq_er = models.Aq_er.objects.filter(is_delete=False,a_team=team.id)
        #love
        love = models.Aq_works.objects.filter(is_delete=False,t_team=team.id)
        #动漫
        aq_anime = models.Aq_anime.objects.filter(is_delete=False,t_team=team.id)
        #动漫SP
        Anime_SP = models.Anime_Sp.objects.filter(is_delete=False,t_team=team.id)
        #活动
        aq_activity = models.Aq_activity.objects.only('activity_title','activity_img').filter(is_delete=False,t_team=team.id)

        return render(request, 'aqours/index.html', locals())

